home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
basic
/
vol_inf.exe
/
VOL-INF.BAS
< prev
Wrap
BASIC Source File
|
1993-05-03
|
2KB
|
94 lines
'created 12/22/92
'updated 04/29/93
DEFINT A-Z
'control over volume labels
DECLARE FUNCTION GETVOL$ (Drive$, ErrCode%)
DECLARE FUNCTION SETVOL% (Drive$, NewName$)
Chr34$ = CHR$(34)
COLOR 7, 1
CLS
LOCATE 1, 22
PRINT "__ Change Volume Label __"
LOCATE 4, 1
LINE INPUT "Enter logical Drive to change: "; Drive$
IF LEN(Drive$) = 0 THEN
Drive$ = "A:"
ELSE
Drive$ = UCASE$(Drive$)
END IF
GOSUB ShowLabel
PRINT
PRINT "A volume label may be upper or lower case or include spaces."
PRINT
LINE INPUT "Please, enter volume label now: "; NewName$
NewName$ = LEFT$(NewName$, 11) 'strip off extra stuff
IF LEN(NewName$) > 0 THEN
T% = SETVOL%(Drive$, NewName$)
PRINT
SELECT CASE T%
CASE 0
GOSUB ShowLabel
CASE -2
PRINT "DOS Version 4 requires SHARE, SHARE not installed."
CASE -3
PRINT "DOS Version 3.xx+ required to change label."
CASE -4
PRINT "Drive is a NETWORK drive, volume label not possible."
CASE -5, 8, 3
PRINT "Invalid character in input string."
GOSUB ShowLabel
CASE 82
PRINT "Error, unable to create that volume label."
PRINT "Directory is full."
CASE 21, 83
PRINT "Error, unable to create that volume label."
PRINT "Drive not ready."
CASE ELSE
PRINT "Error, unable to create that volume label."
PRINT "DOS error:"; T%
END SELECT
ELSE
PRINT "Nothing entered, name unchanged."
PRINT
GOSUB ShowLabel
END IF
END
ShowLabel:
T$ = GETVOL$(Drive$, DosErr%)
IF LEN(T$) > 0 THEN
PRINT "The current volume label for Drive "; Drive$;
IF LEN(Drive$) = 1 THEN PRINT ":";
PRINT " is "; Chr34$; T$; Chr34$
ELSE
SELECT CASE DosErr%
CASE 0
PRINT "No volume label for Drive "; Drive$
CASE 3
PRINT "Drive "; Drive$;
IF LEN(Drive$) = 1 THEN PRINT ":";
PRINT " not found, nothing to do."
END
CASE -1
PRINT "FCB error."
CASE 18
PRINT "No Volume label found."
CASE 21, 83
PRINT "Drive "; Drive$;
IF LEN(Drive$) = 1 THEN PRINT ":";
PRINT " not ready."
CASE ELSE
PRINT "DOS error "; DosErr%
END SELECT
END IF
RETURN